package com.commonsware.android.skeleton;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import java.util.Date;
import android.view.Menu;


public class Now extends Activity implements View.OnClickListener
{
	private Button btn;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        btn = new Button(this);
        btn.setOnClickListener(this);
        updateTime();
        setContentView(btn);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        getMenuInflater().inflate(R.menu.activity_now, menu);
        return true;
    }

	@Override
	public void onClick(View view) 
	{
		updateTime();
	}   
	
	private void updateTime()
	{
		btn.setText(new Date().toString());
	}
}
